﻿<?xml version="1.0" encoding="utf-8"?>
<orm:MappingRoot MapDataStructure="GenDotNetSample" TransactionType="ADONET" Namespace="GenDotNet.Samples" TransactionForRetrieve="false" RetrievePattern="Select_[Object]" SetSelectPattern="SelectAll_[Object]" CreatePattern="Insert_[Object]" UpdatePattern="Update_[Object]" DeletePattern="Delete_[Object]" Generate="CRUDS" CollectionType="plural" xmlns:orm="http://kadgen.com/KADORM.xsd">
  <orm:SQLFunctionReplacement>
    <orm:SQLFunction Name="getdate" ReplaceWith="System.DateTime.Today" NETType="System.DateTime" />
  </orm:SQLFunctionReplacement>
  <orm:UniqueNamespaces />
  <orm:Build MapDataStructure="GenDotNetSample" Name="GenDotNet.Samples">
    <orm:SPSet Name="Contact" ObjectName="Contact" TableName="Contact" OriginalName="Contact" Generate="CRUDS" NoGenStoredProc="false" Schema="dbo" IsChild="true" IsParent="true" IsMultiParentChild="false">
      <orm:RetrieveParameter Name="ContactId" Column="ContactId" Alias="ContactId" UseForDesc="true" OriginalName="ContactId" Caption="Contact Id" Ordinal="0" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
      <orm:WhereClause Clause="@ContactId=[Contact].[ContactId]" />
      <orm:ForeignKeyTables>
        <orm:ForeignKeyTable Name="Customer">
          <orm:ForeignKey ChildColumn="CustomerId" ChildTable="Contact" ChildObject="Contact" ChildProperty="CustomerId" ParentColumn="CustomerId" ParentTable="Customer" ParentObject="Customer" ParentProperty="CustomerId" Ordinal="0" />
        </orm:ForeignKeyTable>
      </orm:ForeignKeyTables>
      <orm:SetSelect TableName="Contact" Schema="dbo">
        <orm:SetSelectColumn Name="ContactId" IsPrimaryKey="true" Column="ContactId" TableName="Contact" SQLType="uniqueidentifier" BaseNETType="System.Guid" NETType="System.Guid" IsAutoIncrement="false" />
        <orm:SetSelectColumn Name="FirstName" IsPrimaryKey="false" Column="FirstName" TableName="Contact" SQLType="nvarchar" BaseNETType="System.String" NETType="System.String" IsAutoIncrement="false" />
        <orm:SetSelectColumn Name="LastName" IsPrimaryKey="false" Column="LastName" TableName="Contact" SQLType="nvarchar" BaseNETType="System.String" NETType="System.String" IsAutoIncrement="false" />
      </orm:SetSelect>
      <orm:BuildRecordset Name="RecSet" InsertPriority="1" ChildFlag="0" ChildName="">
        <orm:WhereClause Clause="@ContactId=[Contact].[ContactId]" />
        <orm:BuildTable Ordinal="0" TableName="Contact" OriginalName="Contact" Name="Contact" JoinStyle="" RightAlias="Contact" Schema="dbo">
          <orm:BuildColumn Name="ContactId" Column="ContactId" Alias="ContactId" UseForDesc="true" OriginalName="ContactId" Caption="Contact Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="CustomerId" Column="CustomerId" Alias="CustomerId" UseForDesc="false" OriginalName="CustomerId" Caption="Customer Id" Ordinal="2" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="FirstName" Column="FirstName" Alias="FirstName" UseForDesc="true" OriginalName="FirstName" Caption="First Name" Ordinal="3" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="LastName" Column="LastName" Alias="LastName" UseForDesc="true" OriginalName="LastName" Caption="Last Name" Ordinal="4" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
        </orm:BuildTable>
        <orm:TableColumn Name="ContactId" TableName="Contact" Column="ContactId" Alias="ContactId" UseForDesc="true" OriginalName="ContactId" Caption="Contact Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Contact" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="CustomerId" TableName="Contact" Column="CustomerId" Alias="CustomerId" UseForDesc="false" OriginalName="CustomerId" Caption="Customer Id" Ordinal="2" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Contact" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="FirstName" TableName="Contact" Column="FirstName" Alias="FirstName" UseForDesc="true" OriginalName="FirstName" Caption="First Name" Ordinal="3" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Contact" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="LastName" TableName="Contact" Column="LastName" Alias="LastName" UseForDesc="true" OriginalName="LastName" Caption="Last Name" Ordinal="4" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Contact" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
      </orm:BuildRecordset>
      <orm:BuildRecordset Name="RecSet1" InsertPriority="2" ChildSPSet="PhoneNumber" TempTableName="PhoneNumber" ChildFlag="1" ChildName="PhoneNumber">
        <orm:WhereClause Clause="@ContactId=[PhoneNumber].[ContactId]" />
        <orm:BuildTable Ordinal="0" TableName="PhoneNumber" OriginalName="PhoneNumber" Name="PhoneNumber" JoinStyle="" RightAlias="PhoneNumber" Schema="dbo">
          <orm:BuildColumn Name="PhoneNumberId" Column="PhoneNumberId" Alias="PhoneNumberId" UseForDesc="true" OriginalName="PhoneNumberId" Caption="Phone Number Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="ContactId" Column="ContactId" Alias="ContactId" UseForDesc="true" OriginalName="ContactId" Caption="Contact Id" Ordinal="2" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="PhoneNumber" Column="PhoneNumber" Alias="PhoneNumber" UseForDesc="true" OriginalName="PhoneNumber" Caption="Phone Number" Ordinal="3" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="20" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Alias="PhoneNumberCategoryId" UseForDesc="true" OriginalName="PhoneNumberCategoryId" Caption="Phone Number Category Id" Ordinal="4" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
        </orm:BuildTable>
        <orm:ChildKey ChildColumn="ContactId" ChildTable="PhoneNumber" ChildAlias="PhoneNumber" ChildObject="PhoneNumber" ChildProperty="ContactId" ParentColumn="ContactId" ParentTable="Contact" ParentAlias="Contact" ParentObject="Contact" ParentProperty="ContactId" />
        <orm:TableColumn Name="PhoneNumberId" TableName="PhoneNumber" Column="PhoneNumberId" Alias="PhoneNumberId" UseForDesc="true" OriginalName="PhoneNumberId" Caption="Phone Number Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumber" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="ContactId" TableName="PhoneNumber" Column="ContactId" Alias="ContactId" UseForDesc="true" OriginalName="ContactId" Caption="Contact Id" Ordinal="2" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumber" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="PhoneNumber" TableName="PhoneNumber" Column="PhoneNumber" Alias="PhoneNumber" UseForDesc="true" OriginalName="PhoneNumber" Caption="Phone Number" Ordinal="3" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="20" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumber" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="PhoneNumberCategoryId" TableName="PhoneNumber" Column="PhoneNumberCategoryId" Alias="PhoneNumberCategoryId" UseForDesc="true" OriginalName="PhoneNumberCategoryId" Caption="Phone Number Category Id" Ordinal="4" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumber" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
      </orm:BuildRecordset>
      <orm:RunSP Name="Insert_Contact" Task="Create">
        <orm:RunSPParam Name="ContactId" Column="ContactId" Table="Contact" OriginalTable="Contact" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
        <orm:RunSPParam Name="CustomerId" Column="CustomerId" Table="Contact" OriginalTable="Contact" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
        <orm:RunSPParam Name="FirstName" Column="FirstName" Table="Contact" OriginalTable="Contact" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
        <orm:RunSPParam Name="LastName" Column="LastName" Table="Contact" OriginalTable="Contact" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
      </orm:RunSP>
      <orm:RunSP Name="Select_Contact" Task="Retrieve">
        <orm:RunSPParam Name="ContactId" Column="ContactId" Table="Contact" OriginalTable="Contact" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="SelectChildren_Customer_Contact" Task="RetrieveChild" TempParentTableName="Customer" TempChildTableName="Contact" ParentObjectName="Customer" ForeignKeyName="Customer">
        <orm:RunSPParam Name="CustomerId" Column="CustomerId" Table="Contact" OriginalTable="Contact" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
      </orm:RunSP>
      <orm:RunSP Name="Update_Contact" Task="Update">
        <orm:RunSPParam Name="ContactId" Column="ContactId" Table="Contact" OriginalTable="Contact" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
        <orm:RunSPParam Name="CustomerId" Column="CustomerId" Table="Contact" OriginalTable="Contact" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
        <orm:RunSPParam Name="FirstName" Column="FirstName" Table="Contact" OriginalTable="Contact" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
        <orm:RunSPParam Name="LastName" Column="LastName" Table="Contact" OriginalTable="Contact" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
      </orm:RunSP>
      <orm:RunSP Name="Delete_Contact" Task="Delete">
        <orm:RunSPParam Name="ContactId" Column="ContactId" Table="Contact" OriginalTable="Contact" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="SelectAll_Contact" Task="SetSelect" />
    </orm:SPSet>
    <orm:SPSet Name="PhoneNumberCategory" ObjectName="PhoneNumberCategory" TableName="PhoneNumberCategory" OriginalName="PhoneNumberCategory" Generate="CRUDS" NoGenStoredProc="false" Schema="dbo" IsChild="false" IsParent="true" IsMultiParentChild="false">
      <orm:RetrieveParameter Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Alias="PhoneNumberCategoryId" UseForDesc="true" OriginalName="PhoneNumberCategoryId" Caption="Phone Number Category Id" Ordinal="0" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
      <orm:WhereClause Clause="@PhoneNumberCategoryId=[PhoneNumberCategory].[PhoneNumberCategoryId]" />
      <orm:ForeignKeyTables />
      <orm:SetSelect TableName="PhoneNumberCategory" Schema="dbo">
        <orm:SetSelectColumn Name="PhoneNumberCategoryId" IsPrimaryKey="true" Column="PhoneNumberCategoryId" TableName="PhoneNumberCategory" SQLType="uniqueidentifier" BaseNETType="System.Guid" NETType="System.Guid" IsAutoIncrement="false" />
        <orm:SetSelectColumn Name="Description" IsPrimaryKey="false" Column="Description" TableName="PhoneNumberCategory" SQLType="nvarchar" BaseNETType="System.String" NETType="System.String" IsAutoIncrement="false" />
      </orm:SetSelect>
      <orm:BuildRecordset Name="RecSet" InsertPriority="0" ChildFlag="0" ChildName="">
        <orm:WhereClause Clause="@PhoneNumberCategoryId=[PhoneNumberCategory].[PhoneNumberCategoryId]" />
        <orm:BuildTable Ordinal="0" TableName="PhoneNumberCategory" OriginalName="PhoneNumberCategory" Name="PhoneNumberCategory" JoinStyle="" RightAlias="PhoneNumberCategory" Schema="dbo">
          <orm:BuildColumn Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Alias="PhoneNumberCategoryId" UseForDesc="true" OriginalName="PhoneNumberCategoryId" Caption="Phone Number Category Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="Description" Column="Description" Alias="Description" UseForDesc="true" OriginalName="Description" Caption="Description" Ordinal="2" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
        </orm:BuildTable>
        <orm:TableColumn Name="PhoneNumberCategoryId" TableName="PhoneNumberCategory" Column="PhoneNumberCategoryId" Alias="PhoneNumberCategoryId" UseForDesc="true" OriginalName="PhoneNumberCategoryId" Caption="Phone Number Category Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumberCategory" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="Description" TableName="PhoneNumberCategory" Column="Description" Alias="Description" UseForDesc="true" OriginalName="Description" Caption="Description" Ordinal="2" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumberCategory" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
      </orm:BuildRecordset>
      <orm:RunSP Name="Insert_PhoneNumberCategory" Task="Create">
        <orm:RunSPParam Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Table="PhoneNumberCategory" OriginalTable="PhoneNumberCategory" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
        <orm:RunSPParam Name="Description" Column="Description" Table="PhoneNumberCategory" OriginalTable="PhoneNumberCategory" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
      </orm:RunSP>
      <orm:RunSP Name="Select_PhoneNumberCategory" Task="Retrieve">
        <orm:RunSPParam Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Table="PhoneNumberCategory" OriginalTable="PhoneNumberCategory" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="Update_PhoneNumberCategory" Task="Update">
        <orm:RunSPParam Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Table="PhoneNumberCategory" OriginalTable="PhoneNumberCategory" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
        <orm:RunSPParam Name="Description" Column="Description" Table="PhoneNumberCategory" OriginalTable="PhoneNumberCategory" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
      </orm:RunSP>
      <orm:RunSP Name="Delete_PhoneNumberCategory" Task="Delete">
        <orm:RunSPParam Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Table="PhoneNumberCategory" OriginalTable="PhoneNumberCategory" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="SelectAll_PhoneNumberCategory" Task="SetSelect" />
    </orm:SPSet>
    <orm:SPSet Name="Customer" ObjectName="Customer" TableName="Customer" OriginalName="Customer" Generate="CRUDS" NoGenStoredProc="false" Schema="dbo" IsChild="false" IsParent="true" IsMultiParentChild="false">
      <orm:RetrieveParameter Name="CustomerId" Column="CustomerId" Alias="CustomerId" UseForDesc="true" OriginalName="CustomerId" Caption="Customer Id" Ordinal="0" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
      <orm:WhereClause Clause="@CustomerId=[Customer].[CustomerId]" />
      <orm:ForeignKeyTables />
      <orm:SetSelect TableName="Customer" Schema="dbo">
        <orm:SetSelectColumn Name="CustomerId" IsPrimaryKey="true" Column="CustomerId" TableName="Customer" SQLType="uniqueidentifier" BaseNETType="System.Guid" NETType="System.Guid" IsAutoIncrement="false" />
        <orm:SetSelectColumn Name="CompanyName" IsPrimaryKey="false" Column="CompanyName" TableName="Customer" SQLType="nvarchar" BaseNETType="System.String" NETType="System.String" IsAutoIncrement="false" />
      </orm:SetSelect>
      <orm:BuildRecordset Name="RecSet" InsertPriority="0" ChildFlag="0" ChildName="">
        <orm:WhereClause Clause="@CustomerId=[Customer].[CustomerId]" />
        <orm:BuildTable Ordinal="0" TableName="Customer" OriginalName="Customer" Name="Customer" JoinStyle="" RightAlias="Customer" Schema="dbo">
          <orm:BuildColumn Name="CustomerId" Column="CustomerId" Alias="CustomerId" UseForDesc="true" OriginalName="CustomerId" Caption="Customer Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="CompanyName" Column="CompanyName" Alias="CompanyName" UseForDesc="true" OriginalName="CompanyName" Caption="Company Name" Ordinal="2" AllowNulls="false" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
        </orm:BuildTable>
        <orm:TableColumn Name="CustomerId" TableName="Customer" Column="CustomerId" Alias="CustomerId" UseForDesc="true" OriginalName="CustomerId" Caption="Customer Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Customer" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="CompanyName" TableName="Customer" Column="CompanyName" Alias="CompanyName" UseForDesc="true" OriginalName="CompanyName" Caption="Company Name" Ordinal="2" AllowNulls="false" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Customer" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
      </orm:BuildRecordset>
      <orm:BuildRecordset Name="RecSet1" InsertPriority="1" ChildSPSet="Contact" TempTableName="Contact" ChildFlag="1" ChildName="Contact">
        <orm:WhereClause Clause="@CustomerId=[Contact].[CustomerId]" />
        <orm:BuildTable Ordinal="0" TableName="Contact" OriginalName="Contact" Name="Contact" JoinStyle="" RightAlias="Contact" Schema="dbo">
          <orm:BuildColumn Name="ContactId" Column="ContactId" Alias="ContactId" UseForDesc="true" OriginalName="ContactId" Caption="Contact Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="CustomerId" Column="CustomerId" Alias="CustomerId" UseForDesc="false" OriginalName="CustomerId" Caption="Customer Id" Ordinal="2" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="FirstName" Column="FirstName" Alias="FirstName" UseForDesc="true" OriginalName="FirstName" Caption="First Name" Ordinal="3" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="LastName" Column="LastName" Alias="LastName" UseForDesc="true" OriginalName="LastName" Caption="Last Name" Ordinal="4" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
        </orm:BuildTable>
        <orm:ChildKey ChildColumn="CustomerId" ChildTable="Contact" ChildAlias="Contact" ChildObject="Contact" ChildProperty="CustomerId" ParentColumn="CustomerId" ParentTable="Customer" ParentAlias="Customer" ParentObject="Customer" ParentProperty="CustomerId" />
        <orm:TableColumn Name="ContactId" TableName="Contact" Column="ContactId" Alias="ContactId" UseForDesc="true" OriginalName="ContactId" Caption="Contact Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Contact" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="CustomerId" TableName="Contact" Column="CustomerId" Alias="CustomerId" UseForDesc="false" OriginalName="CustomerId" Caption="Customer Id" Ordinal="2" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Contact" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="FirstName" TableName="Contact" Column="FirstName" Alias="FirstName" UseForDesc="true" OriginalName="FirstName" Caption="First Name" Ordinal="3" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Contact" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="LastName" TableName="Contact" Column="LastName" Alias="LastName" UseForDesc="true" OriginalName="LastName" Caption="Last Name" Ordinal="4" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="Contact" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
      </orm:BuildRecordset>
      <orm:RunSP Name="Insert_Customer" Task="Create">
        <orm:RunSPParam Name="CustomerId" Column="CustomerId" Table="Customer" OriginalTable="Customer" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
        <orm:RunSPParam Name="CompanyName" Column="CompanyName" Table="Customer" OriginalTable="Customer" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="Select_Customer" Task="Retrieve">
        <orm:RunSPParam Name="CustomerId" Column="CustomerId" Table="Customer" OriginalTable="Customer" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="Update_Customer" Task="Update">
        <orm:RunSPParam Name="CustomerId" Column="CustomerId" Table="Customer" OriginalTable="Customer" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
        <orm:RunSPParam Name="CompanyName" Column="CompanyName" Table="Customer" OriginalTable="Customer" SQLType="nvarchar" NETType="System.String" MaxLength="50" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="Delete_Customer" Task="Delete">
        <orm:RunSPParam Name="CustomerId" Column="CustomerId" Table="Customer" OriginalTable="Customer" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="SelectAll_Customer" Task="SetSelect" />
    </orm:SPSet>
    <orm:SPSet Name="PhoneNumber" ObjectName="PhoneNumber" TableName="PhoneNumber" OriginalName="PhoneNumber" Generate="CRUDS" NoGenStoredProc="false" Schema="dbo" IsChild="true" IsParent="false" IsMultiParentChild="false">
      <orm:RetrieveParameter Name="PhoneNumberId" Column="PhoneNumberId" Alias="PhoneNumberId" UseForDesc="true" OriginalName="PhoneNumberId" Caption="Phone Number Id" Ordinal="0" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
      <orm:WhereClause Clause="@PhoneNumberId=[PhoneNumber].[PhoneNumberId]" />
      <orm:ForeignKeyTables>
        <orm:ForeignKeyTable Name="PhoneNumberCategory">
          <orm:ForeignKey ChildColumn="PhoneNumberCategoryId" ChildTable="PhoneNumber" ChildObject="PhoneNumber" ChildProperty="PhoneNumberCategoryId" ParentColumn="PhoneNumberCategoryId" ParentTable="PhoneNumberCategory" ParentObject="PhoneNumberCategory" ParentProperty="PhoneNumberCategoryId" Ordinal="0" />
        </orm:ForeignKeyTable>
        <orm:ForeignKeyTable Name="Contact">
          <orm:ForeignKey ChildColumn="ContactId" ChildTable="PhoneNumber" ChildObject="PhoneNumber" ChildProperty="ContactId" ParentColumn="ContactId" ParentTable="Contact" ParentObject="Contact" ParentProperty="ContactId" Ordinal="0" />
        </orm:ForeignKeyTable>
      </orm:ForeignKeyTables>
      <orm:SetSelect TableName="PhoneNumber" Schema="dbo">
        <orm:SetSelectColumn Name="PhoneNumberId" IsPrimaryKey="true" Column="PhoneNumberId" TableName="PhoneNumber" SQLType="uniqueidentifier" BaseNETType="System.Guid" NETType="System.Guid" IsAutoIncrement="false" />
        <orm:SetSelectColumn Name="ContactId" IsPrimaryKey="false" Column="ContactId" TableName="PhoneNumber" SQLType="uniqueidentifier" BaseNETType="System.Guid" NETType="System.Guid" IsAutoIncrement="false" />
        <orm:SetSelectColumn Name="PhoneNumber" IsPrimaryKey="false" Column="PhoneNumber" TableName="PhoneNumber" SQLType="nvarchar" BaseNETType="System.String" NETType="System.String" IsAutoIncrement="false" />
        <orm:SetSelectColumn Name="PhoneNumberCategoryId" IsPrimaryKey="false" Column="PhoneNumberCategoryId" TableName="PhoneNumber" SQLType="uniqueidentifier" BaseNETType="System.Guid" NETType="System.Guid" IsAutoIncrement="false" />
      </orm:SetSelect>
      <orm:BuildRecordset Name="RecSet" InsertPriority="2" ChildFlag="0" ChildName="">
        <orm:WhereClause Clause="@PhoneNumberId=[PhoneNumber].[PhoneNumberId]" />
        <orm:BuildTable Ordinal="0" TableName="PhoneNumber" OriginalName="PhoneNumber" Name="PhoneNumber" JoinStyle="" RightAlias="PhoneNumber" Schema="dbo">
          <orm:BuildColumn Name="PhoneNumberId" Column="PhoneNumberId" Alias="PhoneNumberId" UseForDesc="true" OriginalName="PhoneNumberId" Caption="Phone Number Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="ContactId" Column="ContactId" Alias="ContactId" UseForDesc="true" OriginalName="ContactId" Caption="Contact Id" Ordinal="2" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="PhoneNumber" Column="PhoneNumber" Alias="PhoneNumber" UseForDesc="true" OriginalName="PhoneNumber" Caption="Phone Number" Ordinal="3" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="20" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
          <orm:BuildColumn Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Alias="PhoneNumberCategoryId" UseForDesc="true" OriginalName="PhoneNumberCategoryId" Caption="Phone Number Category Id" Ordinal="4" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" />
        </orm:BuildTable>
        <orm:TableColumn Name="PhoneNumberId" TableName="PhoneNumber" Column="PhoneNumberId" Alias="PhoneNumberId" UseForDesc="true" OriginalName="PhoneNumberId" Caption="Phone Number Id" Ordinal="1" AllowNulls="false" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="true" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumber" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="ContactId" TableName="PhoneNumber" Column="ContactId" Alias="ContactId" UseForDesc="true" OriginalName="ContactId" Caption="Contact Id" Ordinal="2" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumber" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="PhoneNumber" TableName="PhoneNumber" Column="PhoneNumber" Alias="PhoneNumber" UseForDesc="true" OriginalName="PhoneNumber" Caption="Phone Number" Ordinal="3" AllowNulls="true" SQLType="nvarchar" NETType="System.String" MaxLength="20" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumber" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
        <orm:TableColumn Name="PhoneNumberCategoryId" TableName="PhoneNumber" Column="PhoneNumberCategoryId" Alias="PhoneNumberCategoryId" UseForDesc="true" OriginalName="PhoneNumberCategoryId" Caption="Phone Number Category Id" Ordinal="4" AllowNulls="true" SQLType="uniqueidentifier" NETType="System.Guid" MaxLength="0" IsPrimaryKey="false" UDTCatalog="" UDTOwner="" UDTName="" IsAutoIncrement="false" IsComputed="false" Precision="0" Scale="0" Schema="dbo" TableAlias="PhoneNumber" JoinBaseRootKey="false" JoinBaseLeafKey="false" />
      </orm:BuildRecordset>
      <orm:RunSP Name="Insert_PhoneNumber" Task="Create">
        <orm:RunSPParam Name="PhoneNumberId" Column="PhoneNumberId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
        <orm:RunSPParam Name="ContactId" Column="ContactId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
        <orm:RunSPParam Name="PhoneNumber" Column="PhoneNumber" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="nvarchar" NETType="System.String" MaxLength="20" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
        <orm:RunSPParam Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
      </orm:RunSP>
      <orm:RunSP Name="Select_PhoneNumber" Task="Retrieve">
        <orm:RunSPParam Name="PhoneNumberId" Column="PhoneNumberId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="SelectChildren_PhoneNumberCategory_PhoneNumber" Task="RetrieveChild" TempParentTableName="PhoneNumberCategory" TempChildTableName="PhoneNumber" ParentObjectName="PhoneNumberCategory" ForeignKeyName="PhoneNumberCategory">
        <orm:RunSPParam Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
      </orm:RunSP>
      <orm:RunSP Name="SelectChildren_Contact_PhoneNumber" Task="RetrieveChild" TempParentTableName="Contact" TempChildTableName="PhoneNumber" ParentObjectName="Contact" ForeignKeyName="Contact">
        <orm:RunSPParam Name="ContactId" Column="ContactId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
      </orm:RunSP>
      <orm:RunSP Name="Update_PhoneNumber" Task="Update">
        <orm:RunSPParam Name="PhoneNumberId" Column="PhoneNumberId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
        <orm:RunSPParam Name="ContactId" Column="ContactId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
        <orm:RunSPParam Name="PhoneNumber" Column="PhoneNumber" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="nvarchar" NETType="System.String" MaxLength="20" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
        <orm:RunSPParam Name="PhoneNumberCategoryId" Column="PhoneNumberCategoryId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="false" IsAutoIncrement="false" AllowNulls="true" />
      </orm:RunSP>
      <orm:RunSP Name="Delete_PhoneNumber" Task="Delete">
        <orm:RunSPParam Name="PhoneNumberId" Column="PhoneNumberId" Table="PhoneNumber" OriginalTable="PhoneNumber" SQLType="uniqueidentifier" NETType="System.Guid" IsPrimaryKey="true" IsAutoIncrement="false" AllowNulls="false" />
      </orm:RunSP>
      <orm:RunSP Name="SelectAll_PhoneNumber" Task="SetSelect" />
    </orm:SPSet>
  </orm:Build>
</orm:MappingRoot>